function critere = Calcul_Critere_Generation(sudoku)


sudoku_genere = sudoku;

M = [];
I = ones(1, 9);

%Boucle sur les colonnes
for j = 1:9
	A = zeros(1, 9);
	R = zeros(1, 9);
	for i = 1:9
		k = sudoku_genere(i, j);
		tmp = A(k);
		A(k) = tmp + 1;
	end
	R = A - I;
	M = [M, R];
end

% Boucle sur les carrés
for i = 1:3
	for j = 1:3
		A = zeros(1, 9);
		R = zeros(1, 9);
		for i1 = 3*i-2:3*i
			for j1 = 3*j-2:3*j
				k = sudoku_genere(i1, j1);
				tmp = A(k);
				A(k) = tmp + 1;
			end
		end
		R = A - I;
		M = [M, R];
	end
end

critere = norm(M, 2);
return;
